<template>
  <div>{{ ajaxResult }}</div>
</template>

<script>
export default {
  inject: ['reload'],
  name: 'Logout',
  data () {
    return {
      ajaxResult: '注销页面'
      // msg: 'Welcome to Your Vue.js App'
    }
  },
  mounted () {
    var _this = this
    this.$axios({
      method: 'post',
      url: '/logout'
    }).then(function (response) {
      _this.$cookies.delete('JSESSIONID')
      _this.$CommonVar.UserInformation = {}
      console.log(response.data)
      _this.reload()
      alert('退出成功!')
      _this.$router.push('/index')
    })
  }

}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>
